import NotFound from '~/components/common/NotFound.vue'
import Forbidding from '~/components/common/Forbidding.vue'
import ServerError from '~/components/common/Error.vue'
import routers from './modules'


import Login from '~/components/backend/Login.vue'
import Index from '~/components/backend/Index.vue'
import Manager from '~/components/backend/Manager.vue'
// import MangerList from '~/components/backend/manager/ManagerList.vue'
import indexPage from '~/components/backend/IndexPage.vue'

//位置相关
import createPosition from '~/components/backend/position/createPosition.vue'
import positionEdit from '~/components/backend/position/positionEdit.vue'
import PositionList from '~/components/backend/position/positionList.vue'


//商品相关
import productList from '~/components/backend/product/productList.vue'
import createProduct from '~/components/backend/product/createProduct.vue'
import productDetail from '~/components/backend/product/productDetail.vue'
import productEdit from '~/components/backend/product/productEdit.vue'
import staticProductDay from '~/components/backend/product/staticProductDay.vue'
import staticProductMonth from '~/components/backend/product/staticProductMonth.vue'

//餐馆统计
import bistroStaticDay from '~/components/backend/product/bistroStaticDay.vue'
import bistroStaticMonth from '~/components/backend/product/bistroStaticMonth.vue'

//订单相关
import orderAll from '~/components/backend/order/orderAll.vue'
import orderList from '~/components/backend/order/orderList.vue'
import orderDetail from '~/components/backend/order/orderDetail.vue'
import orderDetailForAll from '~/components/backend/order/orderDetailForAll.vue'

//用户
import userList from '~/components/backend/user/userList.vue'


//商品分类相关
import productCateGoryList from '~/components/backend/productCategory/productCateGoryList.vue'
import createProductCateGory from '~/components/backend/productCategory/createProductCateGory.vue'
import productCategoryEdit from '~/components/backend/productCategory/productCategoryEdit.vue'

//打印机相关
import printerList from '~/components/backend/printer/printerList.vue'
import machineList from '~/components/backend/printer/machineList.vue'
import createPrinter from '~/components/backend/printer/createPrinter.vue'
import editPrinter from '~/components/backend/printer/editPrinter.vue'
import addMachine from '~/components/backend/printer/addMachine.vue'
import editMachine from '~/components/backend/printer/editMachiner.vue'

const routes = [
  {
    name: 'login',
    path: '/login',
    component: Login,
    meta: {
      requireUnAuth: true,
      title: '登录'
    }
  },
  {
    name: 'index',
    path: '/',
    component: Index,
    meta: {
      requireUnAuth: false,
      title: '首页'
    },
    children: [
      {
        name: 'indexPage',
        path: '/',
        component: indexPage,
        meta: {
          requireUnAuth: false,
          title: '首页'
        }
      },
      {
        name: 'positionList',
        path: '/positionList',
        component: PositionList,
        meta: {
          requireUnAuth: false,
          title: '座位列表'
        },
      },
      {
        name: 'createPosition',
        path: '/createPosition',
        component: createPosition,
        meta: {
          requireUnAuth: false,
          title: '添加座位'
        }

      },
      {
        name: 'positionEdit',
        path: '/positionEdit/:id',
        component: positionEdit,
        meta: {
          requireUnAuth: false,
          title: '修改座位'
        }
      },
      {
        name: 'productList',
        path: '/productList',
        component: productList,
        meta: {
          requireUnAuth: false,
          title: '商品列表'
        }
      },
      {
        name: 'createProduct',
        path: '/createProduct',
        component: createProduct,
        meta: {
          requireUnAuth: false,
          title: '添加商品'
        }
      },
      {
        name: 'productDetail',
        path: '/productDetail/:id',
        component: productDetail,
        meta: {
          requireUnAuth: false,
          title: '商品详情'
        }
      },
      {
        name: 'productEdit',
        path: '/productEdit/:id',
        component: productEdit,
        meta: {
          requireUnAuth: false,
          title: '商品修改'
        }
      },
      {
        name: 'staticProductDay',
        path: '/staticProductDay',
        component: staticProductDay,
        meta: {
          requireUnAuth: false,
          title: '商品日销售统计'
        }
      },
      {
        name: 'staticProductMonth',
        path: '/staticProductMonth',
        component: staticProductMonth,
        meta: {
          requireUnAuth: false,
          title: '商品月销售统计'
        }
      },
      {
        name: 'orderAll',
        path: '/orderAll',
        component: orderAll,
        meta: {
          requireUnAuth: false,
          title: '订单列表'
        }
      },
      {
        name: 'orderList',
        path: '/orderList',
        component: orderList,
        meta: {
          requireUnAuth: false,
          title: '点餐列表'
        }
      },
      {
        name: 'orderDetail',
        path: '/orderDetail/:id',
        component: orderDetail,
        meta: {
          requireUnAuth: false,
          title: '点餐详情'
        }
      },
      {
        name: 'orderDetailForAll',
        path: '/orderDetailForAll/:id',
        component: orderDetailForAll,

      },
      {
        name: 'productCateGoryList',
        path: '/productCateGoryList',
        component: productCateGoryList,
        meta: {
          requireUnAuth: false,
          title: '商品分类列表'
        }
      },
      {
        name: 'createProductCateGory',
        path: '/createProductCateGory',
        component: createProductCateGory,
        meta: {
          requireUnAuth: false,
          title: '添加商品分类'
        }
      },
      {
        name: 'productCategoryEdit',
        path: '/productCategoryEdit/:id',
        component: productCategoryEdit,
        meta: {
          requireUnAuth: false,
          title: '修改商品分类'
        }
      },
      {
        name: 'bistroStaticDay',
        path: '/bistroStaticDay',
        component: bistroStaticDay,
        meta: {
          requireUnAuth: false,
          title: '餐馆日销量统计'
        }
      },
      {
        name: 'bistroStaticMonth',
        path: '/bistroStaticMonth',
        component: bistroStaticMonth,
        meta: {
          requireUnAuth: false,
          title: '餐馆月销量统计'
        }
      },
      {
        name: 'userList',
        path: '/userList',
        component: userList,
        meta: {
          requireUnAuth: false,
          title: '用户列表'
        }
      },
      {
        name: 'printerList',
        path: '/printerList',
        component: printerList,
        meta: {
          requireUnAuth: false,
          title: '打印机列表'
        }
      },
      {
        name: 'machineList',
        path: '/machineList',
        component: machineList,
        meta: {
          requireUnAuth: false,
          title: '终端设备列表'
        }
      },
      {
        name: 'createPrinter',
        path: '/createPrinter',
        component: createPrinter,
        meta: {
          requireUnAuth: false,
          title: '新建打印机'
        }
      },
      {
        name: 'editPrinter',
        path: '/editPrinter/:id',
        component: editPrinter,
        meta: {
          requireUnAuth: false,
          title: '修改打印机'
        }
      },
      {
        name: 'addMachine',
        path: '/addMachine',
        component: addMachine,
        meta: {
          requireUnAuth: false,
          title: '添加终端设备'
        }
      },
      {
        name: 'editMachine',
        path: '/editMachine/:id',
        component: editMachine,
        meta: {
          requireUnAuth: false,
          title: '修改终端设备'
        }
      }
    ]
  },
  {
    name: 'manager',
    path: '/manager',
    component: Manager,
    meta: {
      requireUnAuth: true,
      title: '管理员管理'
    }
  },
  {
    name: 'notFound',
    path: '*',
    component: NotFound,
    meta: {
      requireUnAuth: true,
      isErrorPage: true,
      title: '页面不存在'
    }
  },
  {
    name: 'error',
    path: '/error',
    component: ServerError,
    meta: {
      requireUnAuth: true,
      isErrorPage: true,
      title: '服务器错误'
    }
  },
  {
    name: 'forbidding',
    path: '/forbidding',
    component: Forbidding,
    meta: {
      requireUnAuth: true,
      isErrorPage: true,
      title: '禁止访问'
    }
  },
  {
    path: '/',
    component: Index,
    children: routers
  }
]

export default routes
